/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package tracker.android.sens.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import tracker.android.sens.SensFactory;
import tracker.android.sens.SensPackage;
import tracker.android.sens.Sensor;
import tracker.android.sens.SensorEvent;
import tracker.android.sens.SensorManager;
import tracker.android.sens.SensorThread;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class SensFactoryImpl extends EFactoryImpl implements SensFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static SensFactory init() {
		try {
			SensFactory theSensFactory = (SensFactory)EPackage.Registry.INSTANCE.getEFactory("http:///tracker/android/sens.ecore"); 
			if (theSensFactory != null) {
				return theSensFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new SensFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SensFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case SensPackage.SENSOR: return createSensor();
			case SensPackage.SENSOR_EVENT: return createSensorEvent();
			case SensPackage.SENSOR_MANAGER: return createSensorManager();
			case SensPackage.SENSOR_THREAD: return createSensorThread();
			case SensPackage.THREAD: return createThread();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Sensor createSensor() {
		SensorImpl sensor = new SensorImpl();
		return sensor;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SensorEvent createSensorEvent() {
		SensorEventImpl sensorEvent = new SensorEventImpl();
		return sensorEvent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SensorManager createSensorManager() {
		SensorManagerImpl sensorManager = new SensorManagerImpl();
		return sensorManager;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public tracker.android.sens.Thread createThread() {
		ThreadImpl thread = new ThreadImpl();
		return thread;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SensorThread createSensorThread() {
		SensorThreadImpl sensorThread = new SensorThreadImpl();
		return sensorThread;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SensPackage getSensPackage() {
		return (SensPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static SensPackage getPackage() {
		return SensPackage.eINSTANCE;
	}

} //SensFactoryImpl
